package com.hry.ssm.controller;


import com.hry.ssm.entity.User;
import com.hry.ssm.result.ResponseResult;
import com.hry.ssm.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {


    @Resource
    private UserService userService;

    @GetMapping("/list")
    public ResponseResult<List<User>> list (@RequestParam(defaultValue = "1") int page,@RequestParam(defaultValue = "10")  int size){

        List<User> list = userService.list(page, size);
        return ResponseResult.success(list);


    }
}
